1d159f
@@ -158,6 +158,8 @@
private SegmentIdentifier getSegmentIdentifierAndMaybePush(long truncatedTime) {
                 new LinearShardSpec(currentOpenSegment.getShardSpec().getPartitionNum() + 1)
         );
         pushSegments(Lists.newArrayList(currentOpenSegment));
+        LOG.info("Creating new partition for segment {}, partition num {}",
+                retVal.getIdentifierAsString(), retVal.getShardSpec().getPartitionNum());
         currentOpenSegment = retVal;
         return retVal;
       }
@@ -169,6 +171,7 @@
private SegmentIdentifier getSegmentIdentifierAndMaybePush(long truncatedTime) {
               new LinearShardSpec(0)
       );
       pushSegments(Lists.newArrayList(currentOpenSegment));
+      LOG.info("Creating segment {}", retVal.getIdentifierAsString());
       currentOpenSegment = retVal;
       return retVal;
     }
@@ -187,7 +190,6 @@
private void pushSegments(List<SegmentIdentifier> segmentsToPush) {
                 .makeSegmentDescriptorOutputPath(pushedSegment, segmentsDescriptorDir);
         DruidStorageHandlerUtils
                 .writeSegmentDescriptor(fileSystem, pushedSegment, segmentDescriptorOutputPath);
-
         LOG.info(
                 String.format(
                         "Pushed the segment [%s] and persisted the descriptor located at [%s]",
@@ -217,6 +219,10 @@
public String apply(
                 Joiner.on(", ").join(pushedSegmentIdentifierHashSet)
         ));
       }
+      for (SegmentIdentifier dataSegmentId : segmentsToPush) {
+        LOG.info("Dropping segment {}", dataSegmentId.toString());
+        appenderator.drop(dataSegmentId).get();
+      }
 
       LOG.info(String.format("Published [%,d] segments.", segmentsToPush.size()));
     } catch (InterruptedException e) {
